@(title: String)
@import java.util.Calendar
@main("Just Download") {
<form action="/justdownload" onsubmit="return preCheck();">
    <div class="container">
        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <a href="javascript:void(0);" class="thumbnail" style="border:0px;">
                    <img src="assets/logos/just-download-@{Calendar.getInstance().get(Calendar.DAY_OF_MONTH) % 15}.png" alt="...">
                </a>
            </div>
        </div>

        <div class="row">
            <div class="col-md-8 col-md-offset-2">
                <div class="form-group" id="inputGroup">
                    <label class="control-label" for="urlInput">&nbsp;</label>
                    <input name="url" type="text" class="form-control" id="urlInput">
                    <span class="glyphicon" id="inputSpan"></span>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-md-2 col-md-offset-5">
               <button class="btn btn-default" type="submit">Just Download</button>
            </div>
        </div>

    </div> <!-- /container -->
</form>
}
<script type="text/javascript" charset="utf-8">
$(document).ready(function() {
  if($.trim($("#urlInput").val()).length <= 0){
    $("#urlInput").val("http://");
  }

});

function preCheck(){
  var urlPattern = /\(?(?:(http|https|ftp):\/\/)?(?:((?:[^\W\s]|\.|-|[:]{1})+)@{1})?((?:www.)?(?:[^\W\s]|\.|-)+[\.][^\W\s]{2,4}|localhost(?=\/)|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?::(\d*))?([\/]?[^\s\?]*[\/]{1})*(?:\/?([^\s\n\?\[\]\{\}\#]*(?:(?=\.)){1}|[^\s\n\?\[\]\{\}\.\#]*)?([\.]{1}[^\s\?\#]*)?)?(?:\?{1}([^\s\n\#\[\]]*))?([\#][^\s\n]*)?\)?/gi;
  if(urlPattern.test($("#urlInput").val())){
    return true;
  } else {
    $("#inputGroup").addClass("has-error has-feedback");
    $("#inputSpan").addClass("glyphicon-remove form-control-feedback");

    return false;
  }
}


</script>